package me.pinion.controller;


import me.pinion.controller.annotation.RouteBind;
import me.pinion.model.User;

@RouteBind("/space")
public class SpaceController extends Controller{

    public void index(){
        try{
            int id = getParaToInt(0);
            User user = User.dao.findById(id);
            setAttr("someone", user);
            render("/freemarker/space/index.ftl");
        }catch (Exception e){
            renderError(404);
        }
    }

    public void home(){
        render("/freemarker/space/home.ftl");
    }

    public void profile(){
        this.setAttr("someone", User.dao.findById(getParaToInt(0)));
        render("/freemarker/space/profile.ftl");
    }

    public void timeline(){
        render("/freemarker/space/timeline.ftl");
    }
}
